Optimal. Leaf size=162 \[ -\frac {\left (4 a^2+15 a b+12 b^2\right ) \log (1-\sin (c+d x))}{8 d}+\frac {\left (15 a b-4 \left (a^2+3 b^2\right )\right ) \log (\sin (c+d x)+1)}{8 d}-\frac {2 a b \sin (c+d x)}{d}+\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\sec ^2(c+d x) (a+b \sin (c+d x)) (4 a+5 b \sin (c+d x))}{4 d}-\frac {b^2 \sin ^2(c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.27, antiderivative size = 162, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {2721, 1645, 1810, 633, 31} \[ -\frac {\left (4 a^2+15 a b+12 b^2\right ) \log (1-\sin (c+d x))}{8 d}+\frac {\left (15 a b-4 \left (a^2+3 b^2\right )\right ) \log (\sin (c+d x)+1)}{8 d}-\frac {2 a b \sin (c+d x)}{d}+\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\sec ^2(c+d x) (a+b \sin (c+d x)) (4 a+5 b \sin (c+d x))}{4 d}-\frac {b^2 \sin ^2(c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 633
Rule 1645
Rule 1810
Rule 2721
Rubi steps
\begin {align*} \int (a+b \sin (c+d x))^2 \tan ^5(c+d x) \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^5 (a+x)^2}{\left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}+\frac {\operatorname {Subst}\left (\int \frac {(a+x) \left (-2 b^6-4 a b^4 x-4 b^4 x^2-4 a b^2 x^3-4 b^2 x^4\right )}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{4 b^2 d}\\ &=\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\sec ^2(c+d x) (a+b \sin (c+d x)) (4 a+5 b \sin (c+d x))}{4 d}+\frac {\operatorname {Subst}\left (\int \frac {14 a b^6+8 b^4 \left (a^2+2 b^2\right ) x+16 a b^4 x^2+8 b^4 x^3}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{8 b^4 d}\\ &=\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\sec ^2(c+d x) (a+b \sin (c+d x)) (4 a+5 b \sin (c+d x))}{4 d}+\frac {\operatorname {Subst}\left (\int \left (-16 a b^4-8 b^4 x+\frac {2 \left (15 a b^6+4 b^4 \left (a^2+3 b^2\right ) x\right )}{b^2-x^2}\right ) \, dx,x,b \sin (c+d x)\right )}{8 b^4 d}\\ &=-\frac {2 a b \sin (c+d x)}{d}-\frac {b^2 \sin ^2(c+d x)}{2 d}+\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\sec ^2(c+d x) (a+b \sin (c+d x)) (4 a+5 b \sin (c+d x))}{4 d}+\frac {\operatorname {Subst}\left (\int \frac {15 a b^6+4 b^4 \left (a^2+3 b^2\right ) x}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{4 b^4 d}\\ &=-\frac {2 a b \sin (c+d x)}{d}-\frac {b^2 \sin ^2(c+d x)}{2 d}+\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\sec ^2(c+d x) (a+b \sin (c+d x)) (4 a+5 b \sin (c+d x))}{4 d}+\frac {\left (4 a^2-15 a b+12 b^2\right ) \operatorname {Subst}\left (\int \frac {1}{-b-x} \, dx,x,b \sin (c+d x)\right )}{8 d}+\frac {\left (4 a^2+15 a b+12 b^2\right ) \operatorname {Subst}\left (\int \frac {1}{b-x} \, dx,x,b \sin (c+d x)\right )}{8 d}\\ &=-\frac {\left (4 a^2+15 a b+12 b^2\right ) \log (1-\sin (c+d x))}{8 d}-\frac {\left (4 a^2-15 a b+12 b^2\right ) \log (1+\sin (c+d x))}{8 d}-\frac {2 a b \sin (c+d x)}{d}-\frac {b^2 \sin ^2(c+d x)}{2 d}+\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\sec ^2(c+d x) (a+b \sin (c+d x)) (4 a+5 b \sin (c+d x))}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 2.15, size = 164, normalized size = 1.01 \[ \frac {-2 \left (4 a^2+15 a b+12 b^2\right ) \log (1-\sin (c+d x))-2 \left (4 a^2-15 a b+12 b^2\right ) \log (\sin (c+d x)+1)+\frac {(a-b)^2}{(\sin (c+d x)+1)^2}-\frac {(7 a-11 b) (a-b)}{\sin (c+d x)+1}-32 a b \sin (c+d x)+\frac {(a+b) (7 a+11 b)}{\sin (c+d x)-1}+\frac {(a+b)^2}{(\sin (c+d x)-1)^2}-8 b^2 \sin ^2(c+d x)}{16 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.47, size = 178, normalized size = 1.10 \[ \frac {4 \, b^{2} \cos \left (d x + c\right )^{6} - 2 \, b^{2} \cos \left (d x + c\right )^{4} - {\left (4 \, a^{2} - 15 \, a b + 12 \, b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (4 \, a^{2} + 15 \, a b + 12 \, b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 4 \, {\left (2 \, a^{2} + 3 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, a^{2} + 2 \, b^{2} - 2 \, {\left (8 \, a b \cos \left (d x + c\right )^{4} + 9 \, a b \cos \left (d x + c\right )^{2} - 2 \, a b\right )} \sin \left (d x + c\right )}{8 \, d \cos \left (d x + c\right )^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.31, size = 175, normalized size = 1.08 \[ -\frac {4 \, b^{2} \sin \left (d x + c\right )^{2} + 16 \, a b \sin \left (d x + c\right ) + {\left (4 \, a^{2} - 15 \, a b + 12 \, b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) + {\left (4 \, a^{2} + 15 \, a b + 12 \, b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (3 \, a^{2} \sin \left (d x + c\right )^{4} + 9 \, b^{2} \sin \left (d x + c\right )^{4} + 9 \, a b \sin \left (d x + c\right )^{3} - 2 \, a^{2} \sin \left (d x + c\right )^{2} - 12 \, b^{2} \sin \left (d x + c\right )^{2} - 7 \, a b \sin \left (d x + c\right ) + 4 \, b^{2}\right )}}{{\left (\sin \left (d x + c\right )^{2} - 1\right )}^{2}}}{8 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.32, size = 270, normalized size = 1.67 \[ \frac {a^{2} \left (\tan ^{4}\left (d x +c \right )\right )}{4 d}-\frac {a^{2} \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}-\frac {a^{2} \ln \left (\cos \left (d x +c \right )\right )}{d}+\frac {a b \left (\sin ^{7}\left (d x +c \right )\right )}{2 d \cos \left (d x +c \right )^{4}}-\frac {3 a b \left (\sin ^{7}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{2}}-\frac {3 a b \left (\sin ^{5}\left (d x +c \right )\right )}{4 d}-\frac {5 a b \left (\sin ^{3}\left (d x +c \right )\right )}{4 d}-\frac {15 a b \sin \left (d x +c \right )}{4 d}+\frac {15 a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{4 d}+\frac {b^{2} \left (\sin ^{8}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{4}}-\frac {b^{2} \left (\sin ^{8}\left (d x +c \right )\right )}{2 d \cos \left (d x +c \right )^{2}}-\frac {b^{2} \left (\sin ^{6}\left (d x +c \right )\right )}{2 d}-\frac {3 b^{2} \left (\sin ^{4}\left (d x +c \right )\right )}{4 d}-\frac {3 b^{2} \left (\sin ^{2}\left (d x +c \right )\right )}{2 d}-\frac {3 b^{2} \ln \left (\cos \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.44, size = 157, normalized size = 0.97 \[ -\frac {4 \, b^{2} \sin \left (d x + c\right )^{2} + 16 \, a b \sin \left (d x + c\right ) + {\left (4 \, a^{2} - 15 \, a b + 12 \, b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (4 \, a^{2} + 15 \, a b + 12 \, b^{2}\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac {2 \, {\left (9 \, a b \sin \left (d x + c\right )^{3} - 7 \, a b \sin \left (d x + c\right ) + 2 \, {\left (2 \, a^{2} + 3 \, b^{2}\right )} \sin \left (d x + c\right )^{2} - 3 \, a^{2} - 5 \, b^{2}\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1}}{8 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 12.22, size = 377, normalized size = 2.33 \[ \frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )\,\left (a^2+3\,b^2\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )\,\left (a^2-\frac {15\,a\,b}{4}+3\,b^2\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )\,\left (a^2+\frac {15\,a\,b}{4}+3\,b^2\right )}{d}-\frac {-\frac {15\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}}{2}+\left (-2\,a^2-6\,b^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+\frac {25\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9}{2}+\left (4\,a^2+12\,b^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+11\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (12\,a^2+4\,b^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+11\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (4\,a^2+12\,b^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\frac {25\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{2}+\left (-2\,a^2-6\,b^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-\frac {15\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2}}{d\,\left (-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________